home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Game Programming Gurus / Tricks of the Windows Game Programming Gurus (SAMS)(2000).iso / Engines / PowerRender / pr26eval.zip / PR / EXAMPLES / TESTLAND / LSLIB.H < prev    next >
Encoding:
C/C++ Source or Header  |  1998-06-26  |  4.2 KB  |  139 lines

  1. #ifndef _LSTUDIO_
  2. #define _LSTUDIO_
  3.  
  4. #ifdef __cplusplus
  5.   extern "C" {
  6. #endif
  7.  
  8. #include <terrain.h>
  9.  
  10.  
  11. #define OBJECT_NOT_FOUND -1
  12. #define ENTITY_LOADED 1
  13.  
  14. typedef struct
  15. {
  16.   PR_DWORD TileScale;           /* X/Z axis (size of each square */
  17.   PR_DWORD HeightScale;         /* Y axis */
  18.   PR_DWORD Radius;              /* Number of tiles seen outward from the center */
  19.   PR_DWORD Layers;              /* Number of layers (1,2, or 3) */
  20.   PR_DWORD FogEnabled;          /* True if fogged */
  21.   PR_UCHAR FogR, FogG, FogB;    /* 3Dfx only */
  22.   PR_DWORD FogColor;            /* 3Dfx only (packed version) */
  23.   PR_REAL  FogNear, FogFar;     
  24.   PR_DWORD Mirror;              /* True if reflections are on */
  25. } terrain_settings_struct;
  26. extern terrain_settings_struct Terrain_Settings;
  27.  
  28. typedef struct {
  29.  PR_MATRIX rot_mat;
  30.  PR_POINT location;
  31.  PR_POINT scale;
  32.  PR_DWORD layer;
  33.  PR_DWORD flags;
  34.  PR_UCHAR name[13];
  35.  PR_ENTITY *ent;
  36.  PR_DWORD objnum;
  37. } EntityType;
  38. extern EntityType *EntityList;
  39.  
  40. typedef struct
  41. {
  42.  PR_UCHAR *name;
  43.  PR_OBJECT *obj;
  44.  
  45.  PR_POINT lastscale;
  46.  PR_MATRIX lastrot;
  47.  PR_DWORD lastlayer;
  48. } ObjectType;
  49. extern ObjectType *ObjectList;
  50.  
  51. typedef struct {
  52.  PR_UCHAR r, g, b, a;
  53.  PR_DWORD translucent;
  54.  PR_DWORD keyed;
  55. } TileProperty;
  56. extern TileProperty TileProps[512];
  57.  
  58.  
  59. extern PR_TERRAIN * terrain;
  60. extern PR_DWORD     tilemap[256*2];
  61. extern block        tilesprites[1024];
  62. extern PR_DWORD     TopEntity;
  63. extern PR_DWORD     NumBaseTiles;
  64.  
  65. extern PR_DWORD     MaxObjects;
  66. extern PR_DWORD     MaxEntities;
  67.  
  68.  
  69. void LS_AllocEntities (void);
  70. /* -----------------------------------------------------------------------
  71.    Function:   AllocEntities
  72.    Purpose:    Allocates room for a list of objects
  73.    Parameters: maxobj - Number of objects to allocate space for
  74.    Return:     None
  75.    ----------------------------------------------------------------------- */
  76.  
  77.  
  78. void LS_AllocObjects (void);
  79. /* -----------------------------------------------------------------------
  80.    Function:   LS_AllocObjects
  81.    Purpose:    Allocates room for a list of objects
  82.    Parameters: maxobj - Number of objects to allocate space for
  83.    Return:     None
  84.    ----------------------------------------------------------------------- */
  85.  
  86. void LS_EntityCoordinateFix (PR_ENTITY *ent);
  87. /* -----------------------------------------------------------------------
  88.    Function:   LS_EntityCoordinateFix
  89.    Purpose:    Keeps the distance of from entity to the camera within half
  90.                the map dimensions
  91.    Parameters: ent - Pointer to the entity
  92.    Return:     None
  93.    ----------------------------------------------------------------------- */
  94.  
  95.  
  96. PR_DWORD FindObject (char *filename);
  97. /* -----------------------------------------------------------------------
  98.    Function:   FindObject
  99.    Purpose:    Finds the object number given its filename
  100.    Parameters: filename - Filename of the object
  101.    Return:     OBJECT_NOT_FOUND if the file is not in the ObjectList array
  102.                or object number
  103.    ----------------------------------------------------------------------- */
  104.  
  105.  
  106. PR_DWORD LS_LoadObject (char *filename);
  107. /* -----------------------------------------------------------------------
  108.    Function:   LoadObject
  109.    Purpose:    Loads the object and returns the object number
  110.    Parameters: filename - Filename of the object
  111.    Return:     Index of the object
  112.    ----------------------------------------------------------------------- */
  113.  
  114.  
  115. void LS_LoadTerrain (char *filename);
  116. /* -----------------------------------------------------------------------
  117.    Function:   LS_LoadTerrain
  118.    Purpose:    Loads a Landscape Studio level
  119.    Parameters: filename - Name of the level file (.lsl)
  120.    Return:     None
  121.    ----------------------------------------------------------------------- */
  122.  
  123.  
  124. void LS_RenderObjects (void);
  125. /* -----------------------------------------------------------------------
  126.    Function:   LS_RenderObjects
  127.    Purpose:    Displays the objects in the level
  128.    Parameters: None
  129.    Return:     None
  130.    ----------------------------------------------------------------------- */
  131.  
  132.  
  133. #ifdef __cplusplus
  134. }
  135. #endif
  136.  
  137. #endif
  138.  
  139.